home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / tess / tess-1.0 / pgg.m < prev    next >
Encoding:
Text File  |  1992-06-30  |  832 b   |  35 lines

  1. #import "aGroup-inter.h"
  2. #import "aGroup.h"
  3. #import "pgg.h"
  4.  
  5. @implementation pgg
  6. - makeLatticeUnitAt: (NXPoint *) point fromImage: srcimg 
  7. {
  8.   id imgrep;
  9.   NXPoint pt;
  10.   
  11.   pt.x = - point->x ;
  12.   pt.y = - point->y ;
  13.   imgrep = [srcimg bestRepresentation];
  14.   PSgsave(); // lower left
  15.   [self clip:0.0:0.0];[imgrep drawAt: &pt];
  16.   PSgrestore();
  17.   PSgsave(); // lower right
  18.   reflect(0.0);
  19.   PStranslate(frame.size.width,-frame.size.height);
  20.   [self clip:0.0:0.0]; [imgrep drawAt: &pt];
  21.   PSgrestore();
  22.   PSgsave(); // upper left
  23.   reflect(90);
  24.   PStranslate(-frame.size.width,frame.size.height);
  25.   PSgsave();
  26.   [self clip:0.0:0.0]; [imgrep drawAt: &pt];
  27.   PSgrestore();
  28.   reflect(0.0);// upper right
  29.   PStranslate(frame.size.width,-frame.size.height);
  30.   [self clip:0.0:0.0]; [imgrep drawAt: &pt];
  31.   PSgrestore();
  32.   return self;
  33. }
  34. @end
  35.